<!DOCTYPE html>
<html>
    <head>
        <title>My HTML Page Editor</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link type="text/css" rel="stylesheet" href="/src/view/src/css/reset.css"/>
        <link type="text/css" rel="stylesheet" href="/src/view/src/css/index.css"/>
        <link type="text/css" rel="stylesheet" href="/src/view/src/js/fw/bootstrap/css/bootstrap.min.css"/>
        <script type="text/javascript" src="/src/view/src/js/fw/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="/src/view/src/js/fw/jquery.validate.min.js"></script>
        <script type="text/javascript" src="/src/view/src/js/fw/bootstrap/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="/src/view/src/js/fw/bootstrap/js/bootstrap.plugins.js"></script>
        <script type="text/javascript" src="/src/view/src/js/index.js"></script>
    </head>
    <body>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="brand" href="javascript:">My HTML Page Editor</a>
                </div>
            </div>
        </div>

        <div id="top"  class="pk-top"></div>

        <div class="pk-wrap">
            <form id="postForm" class="form-horizontal" method="post" action="/src/php/Dispose.php">
                <div class="control-group">
                    <label class="control-label">File Path:</label>
                    <div class="controls">
                        <select name="path">
                            {foreach from=$file_list item=item key=key name=list}
                                <option value="{$item}" {if $data.path eq $item || $smarty.foreach.list.index eq 1}selected="selected"{/if}>{$item}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">File Index:</label>
                    <div class="controls">
                        <input class="span1" type="text" name="index" value="{$data.index}"/>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">File Name:</label>
                    <div class="controls">
                        <input class="span7" type="text" name="file_name" placeholder="File Name" value="{$data.file_name}">
                    </div>
                </div>

                <!--标题-->
                <div class="control-group">
                    <label class="control-label">Title:</label>
                    <div class="controls">
                        <input class="span7" type="text" name="title" placeholder="Title" value="{$data.title}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">Title Tip:</label>
                    <div class="controls">
                        <input class="span7" type="text" name="title_tip" placeholder="Title Tip" value="{if $data.title_tip eq ''}Core > Object > Number > {else}{$data.title_tip}{/if}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">Title Desc:</label>
                    <div class="controls">
                        <textarea class="span10" name="title_desc" placeholder="Title Desc" style="height: 800px">{$data.title_desc}</textarea>
                    </div>
                </div>

                <!--参数 可选-->
                <div class="control-group">
                    <label class="control-label">
                        Arguments:
                        <input type="checkbox" data-rel="check_used"/>
                    </label>
                    <div class="controls">
                        <input class="span7" type="text" name="arguments" placeholder="Arguments" value="{$data.arguments}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        Arguments Desc:<input type="checkbox" data-rel="check_used"/>
                    </label>
                    <div class="controls">
                        <p><button type="button" class="btn" id="argumentsAdd"><i class="icon-plus-sign"></i>Add Item</button></p>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th class="common-w100">Name</th>
                                    <th>Desc</th>
                                    <th class="common-w60">Delete</th>
                                </tr>
                            </thead>
                            <tbody id="argumentsAddList">
                                {if $data.arguments neq ''}
                                {foreach from=$data.arguments_desc item=item key=key}
                                    <tr>
                                        <td>
                                            <input type="text" name="arguments_name[]" value="{$key}">
                                        </td>
                                        <td>
                                            <textarea name="arguments_desc[]" class="span6">{$item|replace:'<br />':'&#13'}</textarea>
                                        </td>
                                        <td>
                                            <button onclick="$(this).parent().parent().remove();" class="btn btn-small" type="button"><i class="icon-remove-sign"></i>Del</button>
                                        </td>
                                    </tr>
                                {/foreach}
                                {/if}
                            </tbody>
                        </table>
                    </div>
                </div>

                <!--属性 可选-->
                <div class="control-group">
                    <label class="control-label">
                        Attributes:
                        <input type="checkbox" data-rel="check_used"/>
                    </label>
                    <div class="controls">
                        <input class="span7" type="text" name="attributes" placeholder="Attributes" value="{$data.attributes}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        Attributes Desc:<input type="checkbox" data-rel="check_used"/>
                    </label>
                    <div class="controls">
                        <p><button type="button" class="btn" id="attributesAdd"><i class="icon-plus-sign"></i>Add Item</button></p>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th class="common-w100">Name</th>
                                    <th>Desc</th>
                                    <th class="common-w60">Delete</th>
                                </tr>
                            </thead>
                            <tbody id="attributesAddList">
                                {if $data.attributes neq ''}
                                {foreach from=$data.attributes_desc item=item key=key}
                                    <tr>
                                        <td>
                                            <input type="text" name="attributes_name[]" value="{$key}">
                                        </td>
                                        <td>
                                            <textarea name="attributes_desc[]" class="span6">{$item|replace:'<br />':'&#13'}</textarea>
                                        </td>
                                        <td>
                                            <button onclick="$(this).parent().parent().remove();" class="btn btn-small" type="button"><i class="icon-remove-sign"></i>Del</button>
                                        </td>
                                    </tr>
                                {/foreach}
                                {/if}
                            </tbody>
                        </table>
                    </div>
                </div>

                <!--方法 可选-->
                <div class="control-group">
                    <label class="control-label">
                        Methods:
                        <input type="checkbox" data-rel="check_used"/>
                    </label>
                    <div class="controls">
                        <input class="span7" type="text" name="methods" placeholder="Methods" value="{$data.methods}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                        Methods Desc:<input type="checkbox" data-rel="check_used"/>
                    </label>
                    <div class="controls">
                        <p><button type="button" class="btn" id="methodsAdd"><i class="icon-plus-sign"></i>Add Item</button></p>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th class="common-w100">Name</th>
                                    <th>Desc</th>
                                    <th class="common-w60">Delete</th>
                                </tr>
                            </thead>
                            <tbody id="methodsAddList">
                                {if $data.methods neq ''}
                                {foreach from=$data.methods_desc item=item key=key}
                                    <tr>
                                        <td>
                                            <input type="text" name="methods_name[]" value="{$key}">
                                        </td>
                                        <td>
                                            <textarea name="methods_desc[]" class="span6">{$item|replace:'<br />':'&#13'}</textarea>
                                        </td>
                                        <td>
                                            <button onclick="$(this).parent().parent().remove();" class="btn btn-small" type="button"><i class="icon-remove-sign"></i>Del</button>
                                        </td>
                                    </tr>
                                {/foreach}
                                {/if}
                            </tbody>
                        </table>
                    </div>
                </div>

                <!--返回值-->
                <div class="control-group">
                    <label class="control-label">Return:<input type="checkbox" data-rel="check_used"/></label>
                    <div class="controls">
                        <input class="span7" type="text" name="return" placeholder="Return" value="{$data.return}">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">Return Desc:<input type="checkbox" data-rel="check_used"/></label>
                    <div class="controls">
                        <textarea class="span7" name="return_desc" placeholder="Return Desc" style="height: 200px">{$data.return_desc}</textarea>
                    </div>
                </div>

                <!--Code-->
                <div class="control-group">
                    <label class="control-label">Code:<input type="checkbox" data-rel="check_used"/></label>
                    <div class="controls">
                        <textarea style="height:800px" class="span10" name="code" placeholder="Code">{$data.code}</textarea>
                    </div>
                </div>

                <div class="pk-top-bottom">
                    <ul>
                        <li title="To the top!">
                            <a href="#top"><i class="icon-hand-up"></i></a>
                        </li>
                        <li title="Return home!">
                            <a href="http://pakinguo.jsdoc.com">Home</a>
                        </li>
                        <li title="Delete the file & data from database by the File Name!">
                            <a href="javascript:" id="del">Delete</a>
                        </li>
                        <li title="Load the draft!">
                            <a href="javascript:" id="loadDraft">Load</a>
                        </li>
                        <li title="Save the form as draft!">
                            <a href="javascript:" id="save">Save</a>
                        </li>
                        <li title="Submit the form!">
                            <a href="javascript:"><button type="submit" style="border: none;background: none;color: #08c;">Submit</button></a>
                        </li>
                        <li title="Create nav.html!">
                            <a href="javascript:" id="makeNav">Navbar</a>
                        </li>
                        <li title="Export the database!">
                            <a href="javascript:" id="export">Export</a>
                        </li>
                        <li title="Import the database!">
                            <a href="javascript:" id="import">Import</a>
                        </li>
                        <li title="To the bottom!">
                            <a href="#foot"><i class="icon-hand-down"></i></a>
                        </li>
                    </ul>
                </div>
            </form>

        </div>

        <div id="foot"></div>
    </body>
</html>
